home *** CD-ROM | disk | FTP | other *** search
- #!/usr/local/bin/perl
-
- $className="";
- $parentName="";
- $readingClass=0;
-
- sub generateClass {
- local($className,$parentName,@slots) = @_;
-
- open(OUTFILE,">$className.fig");
-
- print OUTFILE "#FIG 2.1
- 80 2
- 6 279 24 554 174
- 6 279 24 554 174
- 2 2 0 1 7 0 0 21 0.000 0 0 0
- 554 174 279 174 279 24 554 24 554 174 9999 9999
- 1 4 0 1 6 0 0 21 0.000 1 0.000 287 35 7 7 284 29 291 41
- 2 2 0 1 -1 0 0 0 0.000 0 0 0
- 544 104 544 79 419 79 419 104 544 104 9999 9999
- 2 2 0 1 -1 0 0 0 0.000 0 0 0
- 409 104 409 79 289 79 289 104 409 104 9999 9999
- 2 2 0 1 -1 0 0 0 0.000 0 0 0
- 409 134 409 109 289 109 289 134 409 134 9999 9999
- 2 2 0 1 -1 0 0 0 0.000 0 0 0
- 409 164 409 139 289 139 289 164 409 164 9999 9999
- 2 2 0 1 -1 0 0 0 0.000 0 0 0
- 544 134 544 109 419 109 419 134 544 134 9999 9999
- 2 2 0 1 -1 0 0 0 0.000 0 0 0
- 544 164 544 139 419 139 419 164 544 164 9999 9999
- 2 4 0 1 -1 0 0 0 0.000 7 0 0
- 314 99 314 84 294 84 294 99 314 99 9999 9999
- 2 4 0 1 -1 0 0 0 0.000 7 0 0
- 314 129 314 114 294 114 294 129 314 129 9999 9999
- 2 4 0 1 -1 0 0 0 0.000 7 0 0
- 314 159 314 144 294 144 294 159 314 159 9999 9999
- 2 4 0 1 -1 0 0 0 0.000 7 0 0
- 539 159 539 144 519 144 519 159 539 159 9999 9999
- 2 4 0 1 -1 0 0 0 0.000 7 0 0
- 539 129 539 114 519 114 519 129 539 129 9999 9999
- 2 4 0 1 -1 0 0 0 0.000 7 0 0
- 539 99 539 84 519 84 519 99 539 99 9999 9999
- 2 4 0 1 -1 0 0 0 0.000 7 0 0
- 539 44 539 29 519 29 519 44 539 44 9999 9999
- 2 4 0 1 -1 0 0 0 0.000 7 0 0
- 539 69 539 54 519 54 519 69 539 69 9999 9999
- 2 2 0 1 -1 0 0 0 0.000 7 0 0
- 554 174 554 24 279 24 279 174 554 174 9999 9999
- 4 2 30 16 0 1 0 0.000 4 13 62 359 44 Name:
- 4 2 30 16 0 1 0 0.000 4 13 69 359 64 Parent:
- -6\n";
-
- print OUTFILE "4 0 30 16 0 4 0 0.000 4 16 76 364 44 $className\n";
- print OUTFILE "4 0 30 16 0 2 0 0.000 4 16 143 364 64 $parentName\n";
-
- for($i=$#slots; $i<7; $i++) {
- $slots[$i]="noSlot";
- }
-
- print OUTFILE "4 0 20 10 0 -1 0 0.000 4 7 41 320 94 $slots[0]\n";
- print OUTFILE "4 0 20 10 0 -1 0 0.000 4 7 41 430 94 $slots[1]\n";
- print OUTFILE "4 0 20 10 0 -1 0 0.000 4 7 41 320 124 $slots[2]\n";
- print OUTFILE "4 0 20 10 0 -1 0 0.000 4 7 41 430 124 $slots[3]\n";
- print OUTFILE "4 0 20 10 0 -1 0 0.000 4 7 41 320 154 $slots[4]\n";
- print OUTFILE "4 0 20 10 0 -1 0 0.000 4 7 41 430 154 $slots[5]\n";
-
- print OUTFILE "-6\n";
- close(OUTFILE);
- }
-
- @slots=();
-
- while(<>) {
- chop;
- ($label,$value,$rest) = split;
-
- $label =~ y/A-Z/a-z/;
-
- if($label eq "start") {
- if($readingClass) {
- die "Didn't see 'end $className'\n";
- }
- $readingClass=1;
- @slots=();
- }
-
- $className=$value if($label eq "name");
- $parentName=$value if($label eq "parent");
- if($label eq "slot") {
- push(@slots,$value);
- };
-
- if($label eq "parentslot") {
- push(@slots,$value);
- };
-
- if($label eq "end") {
- &generateClass($className,$parentName,@slots);
- $readingClass=0;
- }
- }
-
-
-